// 此模块为models出口文件
// 模型层  进行数据的管理操作MVC  MVVM  ->  model

import { HTTP } from "../utils/http";
import {API} from '../utils/config'

class SearchModel extends HTTP {
  getSearchData (keyword, cityId) {
    return new Promise((resolve, reject) => {
      this.axiosPost({
        url: API.SEARCH_ACTION,
        data: {
          keyword,
          cityId,
        },
        success (data) {
          resolve({
            data,
            status: 0,
          })
        },
        error (err) {
          resolve({
            error: err,
            status: -1,
          })
        }
      })
    })
  }
}

export {
  SearchModel
}


